Not able to create the knowledge base
# support
m
I am following this page and using the same payload to create the new Knowledge base https://docs.vapi.ai/knowledge-base here is the payload but giving error "message": "Invalid Knowledge Base Details. Failed to create trieve dataset", "error": "Bad Request", { "name": "v2", "provider": "trieve", "searchPlan": { "searchType": "semantic", "topK": 3, "removeStopWords": true, "scoreThreshold": 0.7 }, "createPlan": { "type": "create", "chunkPlans": [ { "fileIds": ["a0f1a569-55ed-4ce2-8972-2067243e3ef0"], "websites": [], "targetSplitsPerChunk": 50, "splitDelimiters": [".!?\n"], "rebalanceChunks": true } ] } }
now getting this { "message": "Invalid Knowledge Base Details. Error creating Trieve dataset (Status 404): Not Found: Organization not found", "error": "Bad Request", "statusCode": 400 }
m
Please check that the organization you are trying to create the Knowledge base under exists If your account does not have the right privileges, maybe "Not found" error can be appeared
m
@Mr.Traveller I have everything checked and that correct but still this issue
m
hmm. strange..
m
I am not sure it looks like issue with the knowledge base creation
m
@mauryasumit If you create a dataset in trieve and upload your kb files directly on trieve, generate new trieve api key and paste that in credential provider in Vapi, you can then import your kb to Vapi by making a post request to Vapi api knowledge-base route JSON: { "name": “name your kb file”, "provider": "trieve", "searchPlan": { "scoreThreshold": 0.2, "searchType": "semantic" }, "createPlan": { "type": "import", "providerId": "" } } Doc for detailed breakdown: https://docs.vapi.ai/knowledge-base/integrating-with-trieve
m
That's fine but I was planning to use vapi directly for creation of KB
s
VAPIs handling of knowledge bases is terrible. First they broke the KB UI, forcing everyone to upload their KB using their API. Then they broke the API, forcing everyone to go to Trieve. What kind of professional product development is this?
t
Not able to save api key in provider stating Internal error, are you able to save new key?
a
@samuelpjackson do know of any guide on how to create a dataset on trieve so it can be imported in VAPI?
s
@mauryasumit Is this resolved for you? If not, let me know where you’re blocked. we've noticed that when using our API key for creating a knowledge base, the request sometimes fails with a 403 error. The problem seems to be related to how our system create plan syncs with Trieve, causing issues when the same key is used repeatedly. temporary solution: For now, please use your own Trieve dataset for the knowledge base. This workaround avoids the create plan syncing issue and should let the KB process go through without errors.
@AceOfHeards All you need to do is sign up, upload the files, copy the dataset ID, and use the default settings. That’s it! Use the default settings or config for now.
a
Just did it. Still does not work. I can not import the dataset and not even show the list of datasets. I tried all sorts of API keys in the provider crendentials for trieve nothing seems to work. It looks like the connection to trieve in general is not working
This is the request curl -X POST https://api.vapi.ai/knowledge-base \ -H "Authorization: Bearer xxxxx" \ -H "Content-Type: application/json" \ -d '{ "provider": "trieve", "createPlan": { "type": "import", "providerId": "Dateset ID from Trieve" }, "searchPlan": { "searchType": "hybrid", "removeStopWords": true }, "name": "MyName" }'
And this is the response I get { "message": "Invalid Knowledge Base Details. Failed to validate trieve dataset: dataset not found", "error": "Bad Request", "statusCode": 400 }
This is what I get no matter which trieve API key I use in the provider credentials curl https://api.vapi.ai/knowledge-base \ -H "Authorization: Bearer xxxxxx" []%
s
Here's an example of how to setup the dataset in Trieve:

https://www.youtube.com/watch?v=gNl1bbrjvf8

And then I used this POST request in Postman:
Copy code
POST https://api.vapi.ai/knowledge-base
Headers:
Authorization: Bearer {{vapi_api_key}}

Body:
{
  "name": "{{knowledge_base_name}}",
  "provider": "trieve",
  "searchPlan": {
    "scoreThreshold": 0.2,
    "searchType": "semantic"
  },
  "createPlan": {
    "type": "import",
    "providerId": "{{dataset_id}}"
  }
}
m
so now it's official that we need to first upload the file on
trieve
then use that on VAPI
@Shubham Bajaj
so we shoud change our approch
@Shubham Bajaj "I want to create a knowledge base with multiple files so that I can use it across multiple assistants. To achieve this, I first upload files to Vapi, use them to create a knowledge base (KB), and then assign the KB to an assistant. Given this setup, should I upload the files to different datasets on Trieve or store all files in a single dataset? If using a single dataset is the right approach, please provide the steps to follow. Additionally, if I upload files to multiple datasets, I understand that I would need to create multiple KBs. However, I am unsure how to manage and utilize multiple KBs within an assistant. Could you clarify this process?"
this thing is not working as of now for me
I have changed the key and other stuff
@Shubham Bajaj
s
@mauryasumit deleting your message because of API keys involved. Your curl request is valid it's just that you have use right private API key, your using your public key.
@Mr.Traveller @mccantsquincy @theOG @AceOfHeards @samuelpjackson @mauryasumit Checking where you all are currently blocked (if) with KB!!
2 Views